package com.hw.servlet;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.hw.dagl.service.FrmCodeService;



public class LoadDataServlet extends HttpServlet{
    
    private static final Logger logger=LoggerFactory.getLogger(LoadDataServlet.class);

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	

	public void init() throws ServletException {
	    logger.info("项目起动，进入加载数据进内存的init方法加载开始！");
		ServletContext sc = getServletContext();  
        WebApplicationContext ac = WebApplicationContextUtils.getRequiredWebApplicationContext(sc);  
      
        FrmCodeService frmCodeService=(FrmCodeService) ac.getBean("frmCodeService"); 
        frmCodeService.queryFrmCodeByMap();//加载布控类型、车辆种类、号牌颜色、车辆颜色信息
       
        logger.info("项目起动，进入加载数据进内存的init方法加载结束！");
	}
	
}
